package com.pvo.vo;

import java.util.List;

public class EntityVO {
	
	private String name;
	private String comment;
	private String pkGenMethod;
	private List<FieldVO> fieldList;
	private TableVO tableVO;
	
	public EntityVO() {
		super();
	}
	
	public FieldVO getPkFieldVO() {
		if (fieldList == null || fieldList.isEmpty()) {
			return null;
		}
		for (FieldVO field : fieldList) {
			if (field.isPrimaryKey()) {
				return field;
			}
		}
		return null;
	}

	public TableVO getTableVO() {
		return tableVO;
	}

	public void setTableVO(TableVO tableVO) {
		this.tableVO = tableVO;
	}

	public EntityVO(List<FieldVO> fieldList) {
		super();
		this.fieldList = fieldList;
	}

	public List<FieldVO> getFieldList() {
		return fieldList;
	}

	public void setFieldList(List<FieldVO> fieldList) {
		this.fieldList = fieldList;
	}

	public String getName() {
		return name;
	}
	public String getNameLowerCase() {
		return name.toLowerCase();
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getPkGenMethod() {
		return pkGenMethod;
	}

	public void setPkGenMethod(String pkGenMethod) {
		this.pkGenMethod = pkGenMethod;
	}


	@Override
	public String toString() {
		return "EntityVO [name=" + name + ", comment=" + comment + ", pkGenMethod=" + pkGenMethod + ", fieldList=" + fieldList + "]";
	}


	
	
}
